// app-model.js - A mongoose model
//
// See http://mongoosejs.com/docs/models.html
// for more of what you can do here.
module.exports = function (app) {
  const mongooseClient = app.get('mongooseClient')
  const { Schema } = mongooseClient
  const apps = new Schema({
    name: { type: String, trim: true },
    secret: { type: String, trim: true },
    gateway: { type: String, trim: true },
    hooks: [{ type: String, trim: true }],
    apis: [{ type: String, trim: true }],
    enable: { type: Boolean, default: true },
    del: { type: Boolean, default: false }
  })


  return mongooseClient.model('app', apps)
}
